Skip to content

chore: remove unused ip+loginAt index from Sessions model#41332

Open
rishie81311518 wants to merge 1 commit into
RocketChat:developfrom
rishie81311518:chore/remove-unused-ip-login-index
Open

chore: remove unused ip+loginAt index from Sessions model#41332
rishie81311518 wants to merge 1 commit into
RocketChat:developfrom
rishie81311518:chore/remove-unused-ip-login-index

Conversation

@rishie81311518

@rishie81311518 rishie81311518 commented Jul 13, 2026

Copy link
Copy Markdown

Proposed changes

Removes the commented-out { ip: 1, loginAt: -1 } index definition (and its
TODO) from packages/models/src/models/Sessions.ts. This index's only
consumer, findLastLoginByIp, was removed in #40849, so the index has been
dead code since then. This PR completes the cleanup the original TODO asked
for.

Issue(s)

Fixes #41317

Steps to test or reproduce

  1. Checked out this branch and ran yarn dev.
  2. Confirmed the server starts cleanly with no errors referencing the
    removed index or Sessions.ts.
  3. Searched the codebase for any remaining references to
    findLastLoginByIp or the { ip: 1, loginAt: -1 } index — none found.

Further comments

Checked #40849 (the PR that removed findLastLoginByIp) — it did not
include a migration for dropping this index, so this cleanup follows the
same and doesn't add one either.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Removed an obsolete database index configuration.
    • No user-facing functionality or session behavior changed.

@rishie81311518 rishie81311518 requested a review from a team as a code owner July 13, 2026 00:58
@dionisio-bot

dionisio-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: de32fc9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant

CLAassistant commented Jul 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Removes an obsolete commented-out MongoDB index definition and its TODO from SessionsRaw.modelIndexes(). Active indexes, session logic, queries, and public method signatures remain unchanged.

Changes

Session index cleanup

Layer / File(s) Summary
Remove obsolete index comment
packages/models/src/models/Sessions.ts
Removes the commented-out index definition and its associated TODO from the session model’s index list.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested labels: type: chore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR removes the unused { ip: 1, loginAt: -1 } index TODO from Sessions.ts as requested in #41317.
Out of Scope Changes check ✅ Passed Only the requested Sessions index removal is present, with no unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removing the unused ip+loginAt index from the Sessions model.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@rishie81311518 rishie81311518 changed the title [FIX] Remove unused ip+loginAt index from Sessions model chore: remove unused ip+loginAt index from Sessions model Jul 13, 2026
@rishie81311518

Copy link
Copy Markdown
Author

Signed the CLA. Updated the title to match conventions. This is an internal cleanup, so I don't believe a changeset is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove this index in the next major release (8.0.0) - its only consumer (findLastLoginByIp) was removed

2 participants